package org.gd.hellojavacore.patterns.singleton;

/**
 Class holder on JVM start initialization
 */
@SuppressWarnings("unused")
public class ClassHolderSingleton implements Singleton {

    private ClassHolderSingleton() {

    }

    private static class SingletonHolder {
        public static final ClassHolderSingleton instance = new ClassHolderSingleton();
    }

    public static ClassHolderSingleton getInstance()  {
        return SingletonHolder.instance;
    }
}
